package pers.jphoebe.quartz.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Created by 蒋时华 on 2017/11/2.
 */
@ApiModel(value = "GsiSilverPrice", description = "投资银对象")
public class GsiSilverPrice implements Serializable {

    /**
     * 类型：Ag(T+D)、Au(T+D)
     */
    @ApiModelProperty(value = "类型")
    private String type;
    /**
     * 零售价
     */
    @ApiModelProperty(value = "零售价")
    private BigDecimal retailPriceTotal;
    /**
     * 供货价
     */
    @ApiModelProperty(value = "供货价")
    private BigDecimal supplyPriceTotal;
    /**
     * 价/g
     */
    @ApiModelProperty(value = "价/g")
    private BigDecimal priceByG;
    /**
     * 零售价/g
     */
    @ApiModelProperty(value = "零售价/g")
    private BigDecimal retailPriceByG;
    /**
     * 供货价/g
     */
    @ApiModelProperty(value = "供货价/g")
    private BigDecimal supplyPriceByG;
    /**
     * 数量/重量：请求参数，默认为0   ----金、银
     */
    @ApiModelProperty(value = "克重",required = true)
    private Integer quantity;
    /**
     * 供货价比例：请求参数，默认为1   ----银
     */
    @ApiModelProperty(value = "供货价比例")
    private BigDecimal supplyPriceProportion;
    /**
     * 零售价比例：请求参数，默认为1   ----银
     */
    @ApiModelProperty(value = "零售价比例",required = true)
    private BigDecimal retailPriceProportion;
    /**
     * 银行中收比(零售价比例-供货价比例
     * @return
     */
    @ApiModelProperty(value = "银行中收比")
    private BigDecimal backIncomeProportion;
    /**
     * 银行中收
     * @return
     */
    @ApiModelProperty(value = "银行中收")
    private BigDecimal backIncome;


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getQuantity() {
        return quantity==null?0:quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public BigDecimal getRetailPriceTotal() {
        return retailPriceTotal;
    }

    public void setRetailPriceTotal(BigDecimal retailPriceTotal) {
        this.retailPriceTotal = retailPriceTotal;
    }

    public BigDecimal getSupplyPriceTotal() {
        return supplyPriceTotal;
    }

    public void setSupplyPriceTotal(BigDecimal supplyPriceTotal) {
        this.supplyPriceTotal = supplyPriceTotal;
    }

    public BigDecimal getPriceByG() {
        return priceByG;
    }

    public void setPriceByG(BigDecimal priceByG) {
        this.priceByG = priceByG;
    }

    public BigDecimal getSupplyPriceProportion() {
        return supplyPriceProportion==null?new BigDecimal("1"):supplyPriceProportion;
    }

    public void setSupplyPriceProportion(BigDecimal supplyPriceProportion) {
        this.supplyPriceProportion = supplyPriceProportion;
    }

    public BigDecimal getRetailPriceProportion() {
        return retailPriceProportion==null?new BigDecimal("1"):retailPriceProportion;
    }


    public void setRetailPriceProportion(BigDecimal retailPriceProportion) {
        this.retailPriceProportion = retailPriceProportion;
    }

    public BigDecimal getBackIncomeProportion() {
        return backIncomeProportion==null?(this.getRetailPriceProportion().subtract(this.getSupplyPriceProportion())):backIncomeProportion;
    }


    public void setBackIncomeProportion(BigDecimal backIncomeProportion) {
        this.backIncomeProportion = backIncomeProportion;
    }

    public BigDecimal getBackIncome() {
        return backIncome;
    }

    public void setBackIncome(BigDecimal backIncome) {
        this.backIncome = backIncome;
    }

    public BigDecimal getRetailPriceByG() {
        return retailPriceByG==null?(this.getPriceByG().multiply(this.getRetailPriceProportion())):retailPriceByG;
    }

    public void setRetailPriceByG(BigDecimal retailPriceByG) {
        this.retailPriceByG = retailPriceByG;
    }

    public BigDecimal getSupplyPriceByG() {
        return supplyPriceByG==null?(this.getPriceByG().multiply(this.getSupplyPriceProportion())):supplyPriceByG;
    }

    public void setSupplyPriceByG(BigDecimal supplyPriceByG) {
        this.supplyPriceByG = supplyPriceByG;
    }


}
